﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;

public class GirlMoveToTag : MonoBehaviour
{
    [Header("目标点")]
    public Vector3 tagPos;
    [Header("导航代理")]
    private NavMeshAgent namAgent;

    void Start()
    {
        namAgent = GetComponent<NavMeshAgent>();
    }

    void Update()
    {
        namAgent.SetDestination(tagPos);
    }

    public void SetTagPos(Vector3 tag)
    {
        tagPos = tag;
    }
}
